<template>
  <div>
    <el-card>
      <Category :disabled="!isShowAttrList" />
    </el-card>
    <el-card style="margin-top: 10px">
      <AttrList v-if="isShowAttrList" :visible.sync="isShowAttrList" @setAttr="getAttr" />
      <SaveAttr v-else :attrValue="attrValue" :visible.sync="isShowAttrList" @setAttr="getAttr" />
    </el-card>
  </div>
</template>

<script>
import AttrList from './components/AttrList.vue'
import SaveAttr from './components/SaveAttr.vue'
export default {
  name: 'Attr',
  components: {
    AttrList,
    SaveAttr
  },
  data() {
    return {
      isShowAttrList: true,
      attrValue: ''
    }
  },
  methods: {
    // 获取attrList传过来的数据
    getAttr(row) {
      this.attrValue = row
    }
  }
}
</script>

<style></style>
